home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / TEXPLIST.ZIP / demo / Delphi 2 & 3 / unit1.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1999-02-01  |  3.3 KB  |  138 lines

  1. unit Unit1;
  2.                      
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   ComCtrls, StdCtrls, Menus, ExtCtrls, People, ShellAPI,
  8.  
  9.   // TExportListView Units
  10.   ExportLView, ELV_Main;
  11.  
  12. type
  13.   TForm1 = class(TForm)
  14.     ExportListView1: TExportListView;
  15.     MainMenu1: TMainMenu;
  16.     File1: TMenuItem;
  17.     Print1: TMenuItem;
  18.     PrintSetup1: TMenuItem;
  19.     N1: TMenuItem;
  20.     Exit1: TMenuItem;
  21.     PrinterSetupDialog1: TPrinterSetupDialog;
  22.     Panel1: TPanel;
  23.     PageControl1: TPageControl;
  24.     TabSheet4: TTabSheet;
  25.     TabSheet5: TTabSheet;
  26.     TabSheet2: TTabSheet;
  27.     ListView1: TListView;
  28.     Button1: TButton;
  29.     Button2: TButton;
  30.     Button3: TButton;
  31.     Bevel1: TBevel;
  32.     Shape2: TShape;
  33.     Label2: TLabel;
  34.     Shape3: TShape;
  35.     Label5: TLabel;
  36.     Shape4: TShape;
  37.     Label8: TLabel;
  38.     Label9: TLabel;
  39.     Label10: TLabel;
  40.     Label11: TLabel;
  41.     Label6: TLabel;
  42.     TabSheet1: TTabSheet;
  43.     Shape1: TShape;
  44.     Label1: TLabel;
  45.     Shape6: TShape;
  46.     Label3: TLabel;
  47.     Button4: TButton;
  48.     Button5: TButton;
  49.     procedure PrintSetup1Click(Sender: TObject);
  50.     procedure Print1Click(Sender: TObject);
  51.     procedure Button2Click(Sender: TObject);
  52.     procedure Button1Click(Sender: TObject);
  53.     procedure Label8Click(Sender: TObject);
  54.     procedure Label9Click(Sender: TObject);
  55.     procedure Button5Click(Sender: TObject);
  56.     procedure Button4Click(Sender: TObject);
  57.   private
  58.     { Private declarations }
  59.   public
  60.     { Public declarations }
  61.   end;
  62.  
  63. var
  64.   Form1: TForm1;
  65.  
  66. implementation
  67.  
  68. {$R *.DFM}
  69.  
  70. // *** Print Code ***
  71.  
  72. procedure TForm1.PrintSetup1Click(Sender: TObject);
  73. begin
  74.   // Print Setup
  75.   PrinterSetupDialog1.Execute;
  76. end;
  77.  
  78. procedure TForm1.Print1Click(Sender: TObject);
  79. begin
  80.   // Print
  81.   ExportListView1.Print;
  82. end;
  83.  
  84. // *** Demo 1 Code
  85.  
  86. procedure TForm1.Button2Click(Sender: TObject);
  87. begin
  88.   // Let User choose the Export Type
  89.   ExportListView1.Choose;
  90. end;
  91.  
  92. procedure TForm1.Button1Click(Sender: TObject);
  93. begin
  94.   // Ignore this, it's just my Random People Generator (tm)
  95.   GeneratePeople(ListView1);
  96. end;
  97.  
  98. // *** Demo 2 Code ***
  99.  
  100. procedure TForm1.Button5Click(Sender: TObject);
  101. begin
  102.   with ExportListView1 do
  103.   begin
  104.     ExportType := xMicrosoft_Word;
  105.     Options := Options + [NumberRows]; // We Want Row Numbering
  106.     ViewOnly := True;                  // Export to Screen
  107.     Execute;                           // Do Export
  108.   end;
  109. end;
  110.  
  111. procedure TForm1.Button4Click(Sender: TObject);
  112. begin
  113.   with ExportListView1 do
  114.   begin
  115.     ExportType := xMicrosoft_Word;
  116.     Options := Options + [NumberRows]; // We Want Row Numbering
  117.     ViewOnly := False;                 // Export to Screen
  118.     ExportFile := '';                  // Ensure it's blank, so we get a file dialog
  119.     Execute;                           // Do Export
  120.   end;
  121. end;
  122.  
  123. // *** Please Ignore
  124.  
  125. procedure TForm1.Label8Click(Sender: TObject);
  126. begin
  127.   // Visit our Web Page
  128.   ShellExecute(0, PChar('open'), PChar(cComponentsWebSite), PChar(''), PChar(''), SW_SHOWNORMAL);
  129. end;
  130.  
  131. procedure TForm1.Label9Click(Sender: TObject);
  132. begin
  133.   // Send us E-mail
  134.   ShellExecute(0, PChar('open'), PChar(cComponentsMailto), PChar(''), PChar(''), SW_SHOWNORMAL);
  135. end;
  136.  
  137. end.
  138.